﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Zyg.SSO.Web.Admin.Role
{
    public partial class RoleList : Zyg.SSO.Web.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!base.Account.HavePermission(Zyg.SSO.Core.Business.Permission.RoleManage))
                {
                    throw new Exception("你无权查看此页面");
                }
                BindData();
            }
        }

        private void BindData()
        {
            IList<Zyg.SSO.Core.Business.Role> roles = Zyg.SSO.Core.Business.Role.GetRoles();

            GridViewRoleList.DataSource = roles;
            GridViewRoleList.DataBind();
        }
    }
}
